import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/HomeView.vue')
    },
    {
      path: '/category',
      name: 'category',
      component: () => import('@/views/CategoryView.vue')
    },
    {
      path: '/cart',
      name: 'cart',
      component: () => import('@/views/Cart.vue')
    },
    {
      path: '/mine',
      name: 'mine',
      component: () => import('@/views/Mine.vue')
    },
    {
      path: '/nexttick',
      name: 'nexttick',
      component: () => import('@/views/Nexttickview.vue')
    },
    {
      path: '/computed',
      name: 'computed',
      component: () => import('@/views/Computedview.vue')
    },
    {
      path: '/life',
      name: 'life',
      component: () => import('@/views/Lifeview.vue')
    },
    {
      path: '/watch',
      name: 'watch',
      component: () => import('@/views/Watchview.vue')
    },
    {
      path: '/father',
      name: 'father',
      component: () => import('@/views/Fatherview.vue')
    },
    {
      path: '/kuaji',
      name: 'kuaji',
      component: () => import('@/views/kuaji/Father.vue')
    },
    {
      path: '/xiongdi',
      name: 'xiongdi',
      component: () => import('@/views/brothertobrother/Father.vue')
    },
    {
      path: '/directive',
      name: 'directive',
      component: () => import('@/views/directive/Father.vue')
    },
    {
      path: '/hook',
      name: 'hook',
      component: () => import('@/views/hooks/Father.vue')
    },
    {
      path: '/router',
      name: 'router',
      component: () => import('@/views/router-view/Father.vue'),
      children: [
        {
          path: '/router/news',
          component: () => import('@/views/router-view/News.vue'),
        },
        {
          path: 'sport',
          component: () => import('@/views/router-view/Sport.vue'),
        }
      ]
    },
    {
      path: '/pinia',
      name: 'pinia',
      component: () => import('@/views/pinia-view/Father.vue'),
      children: [
        {
          path: 'home1',
          name: 'home1',
          component: () => import('@/views/pinia-view/Home1.vue')
        },
        {
          path: 'category1',
          name: 'category1',
          component: () => import('@/views/pinia-view/Category1.vue')
        }
      ]
    }
  ]
})

export default router
